__author__ = 'Michael'

prefix=""
#tabulation="|------"
tabulation="      "

class bcolors:
    HEADER = '\033[95m'
    BLUE = '\033[94m'
    GREEN = '\033[92m'
    WARNING = '\033[93m'
    FAIL = '\033[91m'
    ENDC = '\033[0m'

    def disable(self):
        self.HEADER = ''
        self.BLUE = ''
        self.GREEN = ''
        self.WARNING = ''
        self.FAIL = ''
        self.ENDC = ''

def print_properties(prefix, dict):
    for i in dict.keys():
        if type(dict[i])==type({}):
            #print "|"
            print prefix +">" + " " + bcolors.BLUE+ i +bcolors.ENDC + ":"
            print_properties(prefix+tabulation, dict[i])
        else:
            #print prefix + ">" +" "+ bcolors.BLUE+ i + ":" + bcolors.ENDC + "\t\t" + str(dict[i])
            s1=prefix + ">" +" "+ bcolors.BLUE+ i + ":" + bcolors.ENDC
            s2=str(dict[i])
            print "%15s %15s" % (s1,s2)


def print_nice(dict):
    print_properties(" ", dict)

















x={"x1":"v1", "x2":"v2"}
y={"y1":"yyv1", "y2":x}
z={"z1":"asd", "a":"b", "xx":y, "zz":x}

d={'extends': None,
 'library': 'car.library',
 'nature': 'object',
 'objects': {'wheel1': {'extends': None,
                        'nature': 'object',
                        'objects': {},
                        'properties': {},
                        'relations': {'motrice': {'directional': True,
                                                  'from': None,
                                                  'nature': 'relation',
                                                  'to': None}}},
             'wheel2': {'extends': 'wheel',
                        'nature': 'object',
                        'objects': {'boulon': {'nature': 'object'}},
                        'properties': {'color': 'grey', 'size': 'big'},
                        'relations': {'motrice': {'directional': True,
                                                  'from': None,
                                                  'nature': 'relation',
                                                  'to': None}}}},
 'properties': {'color': 'blue', 'size': 'big'},
 'relations': {}}
#print_properties ("", d)
#print d
#print_nice(d)